package org.springshowcase.rpc;

import java.util.List;

import javax.validation.Valid;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springshowcase.core.rpc.AbtractRpcComponent;

/**
 * The Class DwrFacadeImpl.
 */
public class DwrFacadeImpl extends AbtractRpcComponent implements DwrFacade {
	// ---------------------------------------------------------------------
	// Class Variable Declaration
	// ---------------------------------------------------------------------
	/** The Constant logger. */
	private static final Logger logger = LoggerFactory
			.getLogger(DwrFacadeImpl.class);

	/** The dwr service. */
	@Autowired
	DwrService dwrService;

	// ---------------------------------------------------------------------
	// Constructor Method Declaration
	// ---------------------------------------------------------------------
	// ---------------------------------------------------------------------
	// DI Method (setter,getter) Declaration
	// ---------------------------------------------------------------------
	// ---------------------------------------------------------------------
	// this Method (public/private) Declaration
	// ---------------------------------------------------------------------
	// ---------------------------------------------------------------------
	// interface implement Method (public/private) Declaration
	// ---------------------------------------------------------------------
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.springshowcase.dwr.DwrFacade#createUser(org.springshowcase.dwr.User)
	 */
	@Valid 
	public void createUser(User user) {
		dwrService.createUser(user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.springshowcase.dwr.DwrFacade#getUser(org.springshowcase.dwr.User)
	 */
	@Override
	public User getUser(User user) {
		return dwrService.findUser(user);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.springshowcase.dwr.DwrFacade#getUserList()
	 */
	@Override
	public List<User> getUserList() {
		return dwrService.findUserList();
	}
	
	public void exceptionUser() {
		String str = null;
		str.indexOf(".");
	}
	// ---------------------------------------------------------------------
	// abstract implement Method (public/private) Declaration
	// ---------------------------------------------------------------------
	// ---------------------------------------------------------------------
	// abstract Method (public/private) Declaration
	// ---------------------------------------------------------------------

}
